<?php
/* @var $this RecetaController */
/* @var $model Receta */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'receta-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Los campos con <span class="required">*</span> son requeridos.</p>

	<?php echo $form->errorSummary($model); ?>
	<!-- Row with date, Client and doctor -->
	<div class="span-24">
		<div class="span-3">
			<?php echo $form->labelEx($model,'fecha'); ?>
			<?php
				$this->widget('zii.widgets.jui.CJuiDatePicker', array(
				    'model' => $model,
				    'attribute' => 'fecha',
					'language'=>'es',
					'options'=> array('dateFormat'=>'yy/mm/dd',),
				    'htmlOptions' => array(
				        'size' => '10',         // textField size
				        'maxlength' => '10',    // textField maxlength
				    ),
				));
			?>
			<?php echo $form->error($model,'fecha'); ?>
		</div>
		<div class="span-8">
			<?php echo $form->labelEx($model,'cliente'); ?>
			<?php echo $form->dropDownList($model,'cliente',Cliente::model()->getClients(),array('empty'=>'Seleccione el cliente',)); ?>
			<?php echo $form->error($model,'cliente'); ?>
		</div>
		<div class="span-7 last">	
			<?php echo $form->labelEx($model,'medico'); ?>
			<?php echo $form->dropDownList($model,'medico',CHtml::listData(Medico::model()->findAll(array('order'=>'nombre')),'idMedico','nombre'),array('empty'=>'Seleccione un medico',)); ?>
			<?php echo $form->error($model,'medico'); ?>
		</div>
	</div>
	<div class="span-24">
		<div class="span-5">
			<?php echo $form->labelEx($model,'sucursal'); ?>
			<?php echo $form->dropDownList($model,'sucursal',CHtml::listData(Sucursal::model()->findAll(),'idSucursal','descripcion'),array('empty'=>'Seleccione la sucursal',)); ?>
			<?php echo $form->error($model,'sucursal'); ?>
		</div>
		<div class="span-13 last">
			<?php echo $form->labelEx($model,'observacion'); ?>
			<?php echo $form->textArea($model,'observacion',array('rows'=>3, 'cols'=>75)); ?>
			<?php echo $form->error($model,'observacion'); ?>
		</div>
	</div>
	<hr>

	<div class="span-10">
	<div class="span-2">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Continuar' : 'Guardar'); ?>
	</div>
		
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->